#pragma once
#include "afxcmn.h"
#include "WindowDataGrabber.h"
#include "DataReceiver.h"
#include "Observers.h"
#include "AiPlayer.h"
#include "afxwin.h"

#define MAX_PLAYERS 30

// MainWindow dialog
struct PlayerInfo
{
	CString Nick;
	int Stack;
	int Stake;
	CString Action;
	CString Position;
	bool Active;	
	
	PlayerInfo() { Stake = -1; Stake = -1; Active = false; } 
};



class MainWindow : public CDialog, public Observer
{
	DECLARE_DYNAMIC(MainWindow)
	
	PlayerInfo Players[MAX_PLAYERS];
	CBotCore gBC;

public:
	MainWindow(CWnd* pParent = NULL);   // standard constructor
	virtual ~MainWindow();
		
// Dialog Data
	enum { IDD = IDD_DIALOG1 };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog();
	void UpdateGui();

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedSelectwindow();


public:
	CListCtrl		  PlayerList;
	WindowDataGrabber Ssg;

public:
	afx_msg void OnBnClickedStartbtn();
	afx_msg void OnBnClickedStopbtn();


	virtual void AddPlayer(int iPosition, TCHAR *iNickName);
	virtual void RemovePlayer(int iPosition);
	virtual void UpdatePlayerInfo(int iPosition, int iStake, int iStack, TCHAR * Action, TCHAR *Position, bool iActive);
	virtual void UpdateTableInfo(int iPot, TCHAR *iCards, int iSb, int iBb);
	virtual void UpdateDecision(TCHAR *iDecision);

	afx_msg void OnBnClickedButton1();
	afx_msg void OnBnClickedCall();
	afx_msg void OnBnClickedFold();
	afx_msg void OnClose();

public:
	int PlayerPos;
	int Blind;
public:
	int PlayerPosition;
public:
	afx_msg void OnBnClickedSetPos();
public:
	afx_msg void OnBnClickedAllin();
	afx_msg void OnBnClickedAutoplay();
	CButton AutoPlayCheckBox;
	afx_msg void OnBnClickedSetBlind();
};
